<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>

<body>
    <div class="app">
        <button v-on:click="showInfo1">点我</button>
        <button @click="showInfo2(123)">点我</button>
    </div>
    <script>
        Vue.config.productionTip = false
        const vm = new Vue({
            data() {
                return {

                }
            },
            methods: {
                showInfo1(event) {
                    console.log(event, '\n', event.target, '\n', event.target.innerText);
                    console.log(this == vm) //this是vm
                },
                showInfo2(number) {
                    alert(number)
                }
            }
        })
        vm.$mount('.app')
    </script>
</body>

</html>